import cv2
import numpy as np

def gauss_noise(image,mean=0,var=0.001):
    image=np.array(image/255,np.float32)
    noise=np.random.normal(mean,var**0.5,image.shape)
    out=image+noise
    if out.min()<0:
        low_clip=-1
    else:
        low_clip=0
    out=np.clip(out,low_clip,1.0)
    out=np.uint8(out*255)
    return out

img=cv2.imread(r'CV-Pictures/036.jpg')
cv2.imshow('img',img)
gauss_noise=gauss_noise(img,mean=0.0,var=0.00002)
cv2.imshow('gauss_noise',gauss_noise)
dst=cv2.GaussianBlur(gauss_noise,(9,9),0,0)
cv2.imshow('gauss_dst',dst)
cv2.waitKey(0)
cv2.destroyAllWindows()



